package com.ltx.blog_bam.controller;

import com.alibaba.fastjson.JSONObject;
import com.ltx.blog_bam.service.ojTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ojTableController {
    @Autowired
    private ojTableService ojTableService;

    @PostMapping("/tianjia")
    public void tianjia(@RequestBody JSONObject param){
        String topic = param.getString("topic");
        String difficulty = param.getString("difficulty");
        String label = param.getString("label");
        String description = param.getString("description");
        String expected_output = param.getString("expected_output");
        ojTableService.tianjia(topic,difficulty,label,description,expected_output);
    }
}
